﻿@model mvcForum.Web.ViewModels.Update.UpdateUserViewModel
@using mvcForum.Web.Helpers;
@{
	ViewBag.Title = ForumHelper.GetString("EditUser.Title", new { Name = Model.Name });

	Layout = Url.GetThemeBaseUrl() + "areas/forum/views/shared/forumlayout.cshtml";
}
<!-- Views/Profile/Update.cshtml -->
@Html.Partial("Breadcrumb", new Dictionary<String,String>())

	<h2>@ForumHelper.GetString("EditUser.UserProfile", new { Name = Model.Name })</h2>
	<hr />

@if (TempData.ContainsKey("Status")) {
	<p>@TempData["Status"]</p>
}

	<div class="row">
		<div class="col-md-12">
			@using (Html.BeginForm("update", "profile", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal" })) {
				@Html.HiddenFor(t => t.Id)
				@Html.ValidationSummary()
				<div class="form-group">
					@Html.LabelFor(t => t.Name, new { @class = "col-lg-2 control-label" })
					<div class="col-lg-10">
						@Html.TextBoxFor(t => t.Name, new { @class = "form-control", disabled = "disabled" })
					</div>
				</div>
				<div class="form-group">
					@Html.LabelFor(t => t.Email, new { @class = "col-lg-2 control-label" })
					<div class="col-lg-10">
						@Html.TextBoxFor(t => t.Email, new { @class = "form-control" })
					</div>
				</div>
if (!Model.ExternalUser) {
				<div class="form-group">
					@Html.LabelFor(t => t.OldPassword, new { @class = "col-lg-2 control-label" })
					<div class="col-lg-10">
						@Html.PasswordFor(t => t.OldPassword, new { @class = "form-control" })
					</div>
				</div>
				<div class="form-group">
					@Html.LabelFor(t => t.NewPassword, new { @class = "col-lg-2 control-label" })
					<div class="col-lg-10">
						@Html.PasswordFor(t => t.NewPassword, new { @class = "form-control" })
					</div>
				</div>
				<div class="form-group">
					@Html.LabelFor(t => t.RepeatedNewPassword, new { @class = "col-lg-2 control-label" })
					<div class="col-lg-10">
						@Html.PasswordFor(t => t.RepeatedNewPassword, new { @class = "form-control" })
					</div>
				</div>
}
				<hr />
				<div class="form-group">
					@Html.LabelFor(t => t.FullName, new { @class = "col-lg-2 control-label" })
					<div class="col-lg-10">
						@Html.TextBoxFor(t => t.FullName, new { @class = "form-control" })
					</div>
				</div>
				<div class="form-group">
					@Html.LabelFor(t => t.Timezone, new { @class = "col-lg-2 control-label" })
					<div class="col-lg-10">
						@Html.DropDownListFor(t => t.Timezone, TimezoneHelper.GetTimeZones(Model.Timezone), new { @class = "form-control" })
					</div>
				</div>
   				<div class="form-group">
					@Html.LabelFor(t => t.Culture, new { @class = "col-lg-2 control-label" })
					<div class="col-lg-10">
						@Html.DropDownListFor(t => t.Culture, CultureInfoHelper.GetCultures(Model.Culture), new { @class = "form-control" })
					</div>
				</div>
if (Model.AllowUserTheme && Model.Themes != null && Model.Themes.Any()) {
   				<div class="form-group">
					@Html.LabelFor(t => t.Theme, new { @class = "col-lg-2 control-label" })
					<div class="col-lg-10">
						@Html.DropDownListFor(t => t.Theme, new String[] { "" }.Concat(Model.Themes).Select(t => new SelectListItem { Selected = (Model.Theme == t), Text = t, Value = t }), new { @class = "form-control" })
					</div>
				</div>
}
				<div class="form-group">
					<div class="col-lg-offset-2 col-lg-10">
						<button type="submit" class="btn btn-primary">@ForumHelper.GetString("EditUser.Submit")</button>
					</div>
				</div>
			}
		</div>
	</div>
